package com.koron.common.core.util.qywx;

import com.koron.common.core.business.configsettings.utils.ConfigInfoTool;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @ClassName 发送企业微信消息 配置类
 * @description
 * @Author zhouj
 * @Date 2022/3/9 15:13
 */
@Component
public class QywxMessageProperties {

    public String getCorpId() {
        return getPropertiesMap().get("corpId");
    }

    public String getCorpSecret() {
        return getPropertiesMap().get("corpSecret");
    }

    public String getTokenUrl() {
        return getPropertiesMap().get("getToken");
    }

    public String getUserInfoUrl() {
        return getPropertiesMap().get("getUserInfo");
    }

    public String getJscode2sessionUrl() {
        return getPropertiesMap().get("jscode2session");
    }

    public String getMessageSendUrl() {
        return getPropertiesMap().get("messageSend");
    }

    public String getMediaUploadUrl() {
        return getPropertiesMap().get("mediaUpload");
    }

    public Integer getAgentId() {
        return Integer.parseInt(getPropertiesMap().get("agentId"));
    }

    public String getAppId() {
        return getPropertiesMap().get("appId");
    }

    public String getEamRedirectUrl() {
        return getPropertiesMap().get("eamRedirectUrl");
    }

    public Map<String, String> getPropertiesMap() {

        return ConfigInfoTool.getConfigByCode("common", "qywx_message");
    }

}
